<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
   /*5的阶乘=4的阶乘*5
     4的阶乘=3的阶乘*4
     3的阶乘=2的阶乘*3
     2的阶乘=1的阶乘*2
     1的阶乘=1

     递归：需要有退出条件
     */
    function jiecheng(num){
        if(num==1){
            return 1;
        }
        return num*jiecheng(num-1);
    }

    function hanNUOTa(num,src,target,guodu){
        if(num==0){
            return;
        }
        hanNUOTa(num-1,src,guodu,target);
        console.log(`
        将${num}移动到${target}
        `);
        hanNUOTa(num-1,guodu,target,src);
    }

    hanNUOTa(3,'a','c','b');
</script>
</body>
</html>